/* 通用重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', '微软雅黑', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 登录页样式 */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #2c3e50;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
}

.login-box {
    background-color: #fff;
    padding: 40px 30px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #2980b9;
}

/* 后台主页面样式 */
.admin-body {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.admin-sidebar {
    width: 220px;
    background-color: #2c3e50;
    color: #fff;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h2 {
    font-size: 18px;
}

.sidebar-nav {
    margin-top: 20px;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background-color: #34495e;
    color: #fff;
    border-left-color: #3498db;
}

.logout-item {
    margin-top: 30px;
    color: #e74c3c !important;
}

.logout-item:hover {
    background-color: #e74c3c !important;
    color: #fff !important;
    border-left-color: #c0392b !important;
}

/* 主内容区样式 */
.admin-main {
    margin-left: 220px;
    flex: 1;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.admin-header h1 {
    font-size: 22px;
    color: #2c3e50;
}

.user-info {
    font-size: 14px;
    color: #7f8c8d;
}

/* 按钮样式 */
.add-btn {
    padding: 8px 16px;
    background-color: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-btn:hover {
    background-color: #27ae60;
}

.delete-btn {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.edit-btn {
    padding: 8px 16px;
    background-color: #6298ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.edit-btn:hover {
    background-color: #90b7ff;
}

.ban-btn {
    padding: 8px 16px;
    background-color: #ff6c88;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ban-btn:hover {
    background-color: #ffa4b4;
}

.active-btn {
    padding: 8px 16px;
    background-color: #00ff9b;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.active-btn:hover {
    background-color: #7affcb;
}

.search-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #2980b9;
}

/* 数据统计卡片样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-title {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-desc {
    font-size: 12px;
    color: #7f8c8d;
}

.text-green {
    color: #2ecc71;
}

.text-red {
    color: #e74c3c;
}

/* 表格样式 */
.news-table, .type-table, .user-table, .comment-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-table th, .news-table td,
.type-table th, .type-table td,
.user-table th, .user-table td,
.comment-table th, .comment-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.news-table th,
.type-table th,
.user-table th,
.comment-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.news-table tbody tr:hover,
.type-table tbody tr:hover,
.user-table tbody tr:hover,
.comment-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 搜索与筛选栏样式 */
.news-filter-bar, .comment-search-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.search-group {
    display: flex;
    gap: 10px;
}

#news-search, #comment-search, #type-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#news-search, #comment-search {
    width: 300px;
}

#type-select {
    width: 180px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 15px 20px;
    background-color: #2c3e50;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #bdc3c7;
}

#news-form, #type-form, #user-form {
    padding: 20px;
}

#news-form .form-group,
#type-form .form-group,
#user-form .form-group {
    margin-bottom: 20px;
}

#news-form label,
#type-form label,
#user-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

#news-title, #type-name, #user-username, #user-password, #news-image, #news-author {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#news-content {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
}

#news-type, #news-status, #user-role {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.save-btn {
    padding: 10px 20px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.save-btn:hover {
    background-color: #2980b9;
}

.cancel-btn {
    padding: 10px 20px;
    background-color: #7f8c8d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cancel-btn:hover {
    background-color: #95a5a6;
}

/* 近期新闻模块样式 */
.recent-news {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    color: #2c3e50;
}

.view-all {
    font-size: 14px;
    color: #3498db;
    text-decoration: none;
}

.view-all:hover {
    text-decoration: underline;
}

